package com.naiterui.ehp.bs.emr.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.naiterui.ehp.bp.bo.ca.EmrSignBO;
import com.naiterui.ehp.bp.bo.esign.EsignNoSecretBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

import springfox.documentation.annotations.ApiIgnore;

/**
 * @Description 调用签名服务接口
 * @Author gongbaoqiang
 * @Date 2019/11/29 5:44 PM
 */
@ApiIgnore
@RequestMapping("inner")
@FeignClient(name = "emrEsign", url = "${ehp.domain.esign}", configuration = FeignConfiguration.class)
public interface ESignFeignClient {


    @PostMapping("emr/presign")
    EmrSignBO getSignInfo(@RequestParam(value = "emrId") String emrId,
        @RequestParam(value = "inquirerId") Long inquirerId, @RequestParam(value = "requestFrom") Integer requestFrom)
        throws BusinessException;


    @PostMapping("emr/sign")
    void sign(@RequestParam(value = "emrId") String emrId, @RequestParam(value = "pin") String pin,
        @RequestParam(value = "requestFrom") Integer requestFrom) throws BusinessException;

    /**
     * 获取免签信息
     * @param doctorId 医生id
     * @return
     * @throws BusinessException
     */
    @GetMapping("dr/getNoSecretInfo")
    EsignNoSecretBO getNoSecretInfo(@RequestParam("doctorId") Long doctorId) throws BusinessException;
}
